<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <h:head>
        <title>Bienvenido</title>
        <link rel="shortcut icon" href="Data/images/Saved-Data-Utility.ico" type="image/x-icon"/>
        <link rel="stylesheet" href="Data/CSS/ui-layout.css" type="text/css"/>
    </h:head>
    <h:body>
        <p:growl id="msg" showDetail="true" life="10000"/>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="70" collapsible="true" 
                          styleClass=".ui-layout-north" >
                <h:form>
                    <p:menubar>
                        <p:submenu label = "#{conectionBean.user.toUpperCase()}">
                            <p:menuitem value="Pagina Inicial" 
                                        actionListener="#{principalPageBean.setCenterPage('main')}"
                                        icon="ui-icon ui-icon-person"
                                        ajax="false"
                                        />
                            <p:menuitem value="Logout"
                                        ajax ="false"
                                        action="#{conectionBean.logout()}"
                                        icon="ui-icon-extlink" 
                                        />
                        </p:submenu>
                        <f:facet name="options">  
                            <p:outputLabel value="Administrador de Base de Datos Oracle " style="color: #F6AE37;"/>  
                        </f:facet>
                    </p:menubar>
                </h:form>

            </p:layoutUnit>

            <p:layoutUnit position="west" size="270" resizable="true" 
                          collapsible="true" 
                          header="Tools">
                <h:form>
                    <p:slideMenu id="Menu" style="width: 250px; height: 180px">
                        
                        <p:submenu label="Logical Spaces" style="height:30px">

                            <p:submenu label="Crear TableSpace" style="width: 230px;height:30px">

                                <p:menuitem value="TableSpace Permanent"
                                            style="color: black; font-weight: bold;" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('createPermanent')}" />
                                <p:menuitem value="TableSpace Temporary"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('createTemporary')}" />
                                <p:menuitem value="TableSpace Undo"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('createUndo')}" />
                            </p:submenu>

                            <p:submenu label="Modificar TableSpace" style="width: 230px;height:30px">
                                <p:menuitem value="Modificar Permanent"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('modifyPermanent')}"/> 
                                <p:menuitem value="Modificar Temporary"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('modifyTemporary')}" />
                                <p:menuitem value="Modificar Undo"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('modifyUndo')}" />
                            </p:submenu>
                            
                            <p:submenu label="Eliminar TableSpace" style="width: 230px;height:30px">
                                <p:menuitem value="Eliminar Permanent"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('deletePermanent')}" /> 
                                <p:menuitem value="Eliminar Temporary"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('deleteTemporary')}" />
                                <p:menuitem value="Eliminar Undo"
                                            style="color: black; font-weight: bold" update="centro"
                                            ajax="false"
                                            action="#{principalPageBean.setCenterPage('deleteUndo')}" />
                            </p:submenu>
                            <p:menuitem value="Estado de TableSpace"
                                        style="color: black; font-weight: bold" update="centro"
                                        ajax="false"
                                        action="#{principalPageBean.setCenterPage('tableSpaceState')}" />
                        </p:submenu>
                        
                        <p:submenu label="Physical Spaces" style="height:30px">

                            <p:menuitem value="Data Files"
                                        style="color: black; font-weight: bold;" update="centro"
                                        ajax="false"
                                        action="#{principalPageBean.setCenterPage('dataFiles')}" />
                            <p:menuitem value="Temp Files"
                                        style="color: black; font-weight: bold" update="centro"
                                        ajax="false"
                                        action="#{principalPageBean.setCenterPage('tempFiles')}" />
                            <p:menuitem value="Control Files"
                                        style="color: black; font-weight: bold" update="centro"
                                        ajax="false"
                                        action="#{principalPageBean.setCenterPage('physicalSpaces')}" />
                        </p:submenu>

                        <p:submenu label="Security" style="height:80px" 
                                   id="menuSeguridad">
                            <p:menuitem value="Users" id="itemUser"
                                        ajax="false"
                                        action="#{principalPageBean.setCenterPage('user')}"
                                        style="color: black; font-weight: bold" update="centro"
                                        />
                            <p:menuitem value="Roles"
                                        ajax="false"
                                        action="#{principalPageBean.setCenterPage('roles')}"
                                        style="color: black; font-weight: bold" update="centro"
                                        />
                            <p:menuitem value="Profiles"
                                        ajax="false"
                                        action="#{principalPageBean.setCenterPage('profiles')}"
                                        style="color: black; font-weight: bold" update="centro"
                                        />
                        </p:submenu>

                    </p:slideMenu>
                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="center" id="centro">


                <h:panelGroup rendered="#{principalPageBean.centerPage eq 'main'
                                          or principalPageBean.centerPage eq null}">
                    <ui:include src="info.xhtml"/>
                </h:panelGroup>

                <h:panelGroup rendered="#{principalPageBean.centerPage eq 'physicalSpaces'}">
                    <ui:include src="PhysicalSpaces/ControlFile.xhtml"/>
                </h:panelGroup>

                <h:panelGroup rendered="#{principalPageBean.centerPage eq 'dataFiles'}">
                    <ui:include src="PhysicalSpaces/ManagmentDataFiles.xhtml"/>
                </h:panelGroup>
                
                <h:panelGroup rendered="#{principalPageBean.centerPage eq 'tempFiles'}">
                    <ui:include src="PhysicalSpaces/ManagmentTempFiles.xhtml"/>
                </h:panelGroup>

                <h:panelGroup rendered="#{principalPageBean.centerPage eq 'user'}">
                    <ui:include src="Security/users.xhtml"/>
                </h:panelGroup>

                <h:panelGroup rendered="#{principalPageBean.centerPage eq 'roles'}">
                    <ui:include src="Security/roles.xhtml"/>
                </h:panelGroup>
                
                <c:if test="#{principalPageBean.centerPage eq 'createPermanent'}">
                    <ui:include src="LogicalSpaces/createTableSpacePermanent.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'createTemporary'}">
                    <ui:include src="LogicalSpaces/createTableSpaceTemporary.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'createUndo'}">
                    <ui:include src="LogicalSpaces/createTableSpaceUndo.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'modifyPermanent'}">
                    <ui:include src="LogicalSpaces/modifyTableSpacePermanent.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'modifyTemporary'}">
                    <ui:include src="LogicalSpaces/modifyTableSpaceTemporary.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'modifyUndo'}">
                    <ui:include src="LogicalSpaces/modifyTableSpaceUndo.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'deletePermanent'}">
                    <ui:include src="LogicalSpaces/deleteTableSpacePermanent.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'deleteTemporary'}">
                    <ui:include src="LogicalSpaces/deleteTableSpaceTemporary.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'deleteUndo'}">
                    <ui:include src="LogicalSpaces/deleteTableSpaceUndo.xhtml" />
                </c:if>
                <c:if test="#{principalPageBean.centerPage eq 'tableSpaceState'}">
                    <ui:include src="LogicalSpaces/reviewTableSpaceState.xhtml" />
                </c:if>
                
                <h:panelGroup rendered="#{principalPageBean.centerPage eq 'profiles'}">
                    <ui:include src="Security/profiles.xhtml"/>
                </h:panelGroup>

            </p:layoutUnit>
        </p:layout>        
    </h:body>
</html>

